﻿using System.Security.Principal;
using System.Web.Security;

namespace BlankMvc.Models {
	public class UserIdentity : IIdentity {
		private readonly FormsAuthenticationTicket ticket;

		public UserIdentity(FormsAuthenticationTicket _ticket) {
			ticket = _ticket;
		}

		public string AuthenticationType {
			get { return "User"; }
		}

		public bool IsAuthenticated {
			get { return true; }
		}

		public string Name {
			get { return ticket.Name; }
		}

		public string UserId {
			get { return ticket.UserData; }
		}
	}
}